#!/bin/bash
# Test forever. Or not, if something goes wrong.

run=1
i=1

while (( $run ))
do
	echo "Making test number $i..."
	run=0
	ruby test.rb > /dev/null
	( java Main < input ) > ours
	( diff -q ours output ) > /tmp/diff
	# Check if output is greater than one byte
	if [ -s /tmp/diff ]
	then
		
		run=0
		echo "E R R O R. Abort."

	else
		run=1
	fi

	cat /tmp/diff

	echo "Test with $(wc -l input) lines passed!"

	i=$((i+1))

done
